import React, { Component } from "react"
import IconStyles from "@/font_icon/iconfont.css"
import Styles from '@/scss/rights.scss'
import { inject, observer } from "mobx-react"
//引入常量
import CONSTS from "@/inits/consts"
const STATE = CONSTS.STATE
/* 新建表单栏   传入一个新建点击函数 此组件在right组件中判断调用 */
@inject('store')
@observer
class CreateDone extends Component<any, any>{
  //修改当前状态为创建状态,用于切换创建表单
  handleCreate=()=>{
    this.props.store.hadleNowstate(CONSTS.STATE.CREATE) //调用store 4修改当前显示状态方法
    this.props.showModal(STATE.CREATE) //调用父类的显示隐藏表单方法
  }
  render() {
    return (
      <div className={Styles.add} onClick={() => { this.handleCreate() }}>
        <i className={`${IconStyles.iconfont} ${IconStyles.icon_jia}`}></i>
      新建待办
      </div>
    )
  }
}


export default CreateDone